home *** CD-ROM | disk | FTP | other *** search
- /*
- * Copyright (C) 1990-1992 Michael Davidson.
- * All rights reserved.
- *
- * Permission to use, copy, modify, and distribute this software
- * and its documentation for any purpose and without fee is hereby
- * granted, provided that the above copyright notice appear in all
- * copies and that both that copyright notice and this permission
- * notice appear in supporting documentation.
- *
- * This software is provided "as is" without express or implied warranty.
- */
-
- #ifndef VIDEO_H
- #define VIDEO_H
-
- /*
- * video mode
- */
- struct __vmode
- {
- int width;
- int height;
- int depth;
- int flags;
- };
-
- typedef struct __vmode vmode_t;
-
- #define V_MODE_SUPPORTED 0x80
- #define V_TEXT_MODE 0x01
- #define V_GRAPHICS_MODE 0x02
-
- /*
- * color map
- */
- typedef struct __color
- {
- unsigned char red;
- unsigned char green;
- unsigned char blue;
- } color_t;
-
- typedef unsigned char pixel8_t;
-
- typedef struct
- {
- unsigned char r;
- unsigned char g;
- unsigned char b;
- } pixel24_t;
-
- /*
- * font structure
- */
- typedef struct __font
- {
- int f_width;
- int f_height;
- unsigned char *f_data;
- } font_t;
-
- void vidInit(char *);
- void vidReset();
- vmode_t *vidGetModes();
- vmode_t *vidModeInfo(int);
- int vidGetMode();
- int vidSetMode(int);
- char *vidGetName();
- void vidSetGamma(long, long, long);
- void vidSetGraphicsRedraw(int (*)());
- int vidPutPixels8(int x, int y, pixel8_t *pixels, int npixels);
- int vidPutPixels24(int x, int y, pixel24_t *pixels, int npixels);
- int vidCheckScreenSwitch(int);
- void vidPutText(int x, int y, char *buf, int nbytes, int fg, int bg);
- void vidDrawText(int x, int y, char *text, int len, font_t *font);
-
- /*
- * Pixel lookup table for 8 bit displays
- */
- extern unsigned char VPixelLookup[];
-
- /*
- * Gamma correction lookup tables
- */
- extern unsigned char RGB8Lookup[3][256];
-
- extern unsigned char RGB32Bits[3];
- extern unsigned char RGB32Shift[3];
- extern unsigned long RGB32Lookup[3][256];
-
- extern font_t *Font8x14;
- extern font_t *DefaultFont;
-
- extern unsigned Black;
- extern unsigned White;
-
- #endif /* VIDEO_H */
-